package adminDynamicFieldModel

import (
	adminDynamicFieldEntry "gitee.com/krio/ginc/example/internal/admin/dynamic/field/entry"
	commonModel "gitee.com/krio/ginc/example/internal/common/model/common"
)

const DynamicFieldTableName = "dynamic_field"

func (*DynamicField) TableName() string {
	return DynamicFieldTableName
}

type DynamicField struct {
	commonModel.Basic `xorm:"extends"`
	Label             string                             `xorm:"varchar(50) 'label' comment('名称')"`
	Key               string                             `xorm:"varchar(50) 'key' comment('标识')"`
	Attr              string                             `xorm:"json 'attr' comment('属性')"`
	WebType           string                             `xorm:"json 'web_type' comment('前端组件')"`
	Required          adminDynamicFieldEntry.FieldBool   `xorm:"varchar(10) 'required' comment('是否必填')"`
	DefaultValue      string                             `xorm:"varchar(255) 'default_value' comment('默认值')"`
	Remark            string                             `xorm:"varchar(255) 'remark' comment('备注')"`
	SelectExt         adminDynamicFieldEntry.FieldSelect `xorm:"json 'select_ext' comment('附属规则：下拉')"`
	DateExt           adminDynamicFieldEntry.FieldDate   `xorm:"json 'date_ext' comment('附属规则：日期')"`
	Status            commonModel.DataStatus             `xorm:"int 'status' comment('状态')"`
}
